package cn.edu.ctbu.labtest.service;


import cn.edu.ctbu.labtest.dao.StudentRepository;
import cn.edu.ctbu.labtest.domain.Student;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface  StudentService {



    /**
     * 读取所有的学生数据
     */
     List<Student> findAll();

    /**
     *
     * @return
     */
     List<Student> findByName(String name);

    /**
     * 只分页的查询
     * @param pageable
     * @return
     */
     Page<Student> findAll(Pageable pageable);

     List<Student> findByExample(Example<Student> student);


    Page<Student> findBySex(Integer sex,Pageable pageable);

     List<Student>  getAll(List<Student> students);


//    /**
//     * 分页，带过滤的查询
//     *@param pageable
//     *@return
//    */
//   List<Student> getAbcAll(List<Student> student);
//



    /**
     * 插入学生
     * @param student
     * @return
     */
    Student insert(Student student);


    /**
     * 更新学生
     * @param student
     * @return
     */
    Student update(Student student);

    void delete(Student student);

    void delete(Integer id);

    Student getById(Integer id);
}
